home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_06_07
/
v6n7072a.txt
< prev
next >
Wrap
Text File
|
1989-09-26
|
941b
|
44 lines
/* putchar() and puts() functions for device driver */
/*
SYNOPSIS
putchar(c);
puts(s);
int c; character to be sent to screen
char *s; string to be sent to screen
DESCRIPTION
These functions can be called by a device driver to send output to the screen
through the ROM BIOS, instead of the standard output. They act very much
like their standard C counterparts, using \n as a line terminator. However,
puts() does not automatically put a \n at the end of the string. CAUTION: Do
not include stdio.h; that would cause the wrong version of putchar() to be
compiled.
*/
#include <dos.h>
void putchar(c) int c; {
union REGS r;
if (c=='\n') putchar('\r');
r.h.ah = 14;
r.h.al = c;
r.x.bx = 0;
int86(0x10, &r, &r);
}
void puts(s) char *s; {
while (*s) putchar(*s++);
/*
for complete compatibility with the standard C function,
add the command putchar('\n');
*/
}